﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;

namespace CompositionPlugin
{
    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple=false)]
    public class ModuleExportAttribute : PluginExportAttribute, IModuleMetadata
    {
        public ModuleExportAttribute(string id, string moduleName, Type moduleType)
            : base(id, null, typeof(IModule))
        {
            this.Name = moduleName;
            this.ModuleType = moduleType;
            this.ActiveType = ModuleActiveType.OnDemand;
        }

        public Type ModuleType { get; private set; }

        public ModuleActiveType ActiveType { get; set; }
    }
}
